#!/usr/bin/env bash

set -o errexit
set -o nounset
set -o pipefail

WORKING_SUFFIX=$(if ! git diff --exit-code --quiet HEAD >&2; \
                 then echo "-WIP"; \
                 else echo ""; \
                 fi)
BRANCH_PREFIX=$(git rev-parse --abbrev-ref HEAD)
echo "${BRANCH_PREFIX//\//-}-$(git rev-parse --short HEAD)$WORKING_SUFFIX"
